<%--
    Document   : managestock
    Created on : Mar 24, 2011, 5:16:47 PM
    Author     : Bryan Hyde
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
        <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/css/template_css.css" media="screen"
              type="text/css" />
        <html:base/>
    </head>
    <body>
        <div class="container">
            <div class="header">
                <a href="#"><img src="${pageContext.servletContext.contextPath}/img/grlg.png" alt="Insert_logo" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #C6D580; display:block;"></a>
            </div><!-- end .header -->
            <div class="content">
                <div>
                    <div align="right"> <html:link page="/views/menu.jsp">Home</html:link>&nbsp;&nbsp;<br/></div>
                    <html:form action="addStockItem" method="post">
                        <table width="625">
                            <tr>
                                <td width="70" >Stock ID</td><td><html:text property="stockID" value="" size="15"/></td>
                            </tr>
                            <tr>
                                <td width="70" >Name</td><td><html:text property="stockName" value="" size="100"/></td>
                            </tr>
                            <tr>
                                <td width="70" >Description</td><td><html:text property="stockDescription" value="" size="100"/></td>
                            </tr>
                            <tr>
                                <td width="70" >Unit Price</td><td><html:text property="stockPrice" value="" size="15"/></td>
                            </tr>
                            <tr>
                                <td width="70" >Inventory</td><td><html:text property="stockInventory" value="" size="15"/></td>
                            </tr>
                            <tr>
                                <td width="70"  colspan="2">
                                    <html:radio property="itemTypes" value="normal" />
                                    <label for="12">Normal</label>
                                    <html:radio property="itemTypes"  value="card" />
                                    <label for="1">Card</label>
                                    <html:radio property="itemTypes"  value="specialbox" />
                                    <label for="2">Special Box</label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"><html:submit value="add"/></td>
                            </tr>
                            <td>&nbsp;</td>
                        </table>
                    </html:form>
                </div>
                <html:form action="editStockItem" method="post">
                    <div  style="width:645px;height:230px;overflow:auto;">
                        <table width="625" border="1">
                            <tr bgColor="#FFFFB4">
                                <td width="40">ID</td>
                                <td width="150">Name</td>
                                <td width="250">Description</td>
                                <td width="70">Price</td>
                                <td width="70">Qty</td>
                                <td width="70">Type</td>
                            </tr>

                            <c:forEach var="s" items="${stock}">
                                <tr>
                                    <td width="40"><html:submit property="edit" value="${s.id}"/></td>
                                    <td width="140">${s.name}</td>
                                    <td width="250">${s.description}</td>
                                    <td width="70"><fmt:formatNumber type="currency" value="${s.price}" /></td>
                                    <td width="70">${s.inventory}</td>
                                    <td width="70">
                                        <c:if test="${s.card}" >Card</c:if>
                                        <c:if test="${s.specialBox}" >Special Box</c:if>
                                        <c:if test="${!s.specialBox && !s.card}" >Normal</c:if>


                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                    </html:form>
                    <div style="padding: 15px"> <html:errors /></div>

                </div>
            </div><!-- end .content -->
        </div><!-- end .container -->
        <div class="footer">
            <p>Copyright 2011&nbsp;TigerSoft</p>
        </div><!-- end .footer -->
    </body>
</html>